package com.mallcloud.mall.product.api.vo;

import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@ApiModel(value = "AppSpuVO", description = "spu信息VO")
@Data
public class AppSpuVO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "spuID")
    private Long spuId;

    @ApiModelProperty(value = "品牌ID")
    private Long brandId;

    @ApiModelProperty(value = "分类ID")
    private Long categoryId;

    @ApiModelProperty(value = "店铺分类ID")
    private Long shopCategoryId;

    @ApiModelProperty(value = "店铺id")
    private Long shopId;

    @ApiModelProperty(value = "商品名称")
    private String name;

    @ApiModelProperty(value = "卖点")
    private String sellingPoint;

    @ApiModelProperty(value = "商品介绍主图")
    private String mainImgUrl;

    public void setMainImgUrl(String mainImgUrl) {
        this.mainImgUrl = mainImgUrl;
        this.hasSkuImg = StrUtil.isNotBlank(mainImgUrl);
    }

    @ApiModelProperty(value = "商品图片 多个图片逗号分隔")
    private String imgUrls;

    @ApiModelProperty(value = "售价，整数方式保存")
    private BigDecimal priceFee;

    @ApiModelProperty(value = "市场价，整数方式保存")
    private BigDecimal marketPriceFee;

    @ApiModelProperty(value = "状态 0:下架, 1:上架")
    private Boolean status;

    @ApiModelProperty(value = "sku是否含有图片 0无 1有")
    private Boolean hasSkuImg;

    @ApiModelProperty(value = "排序")
    private Integer sortOrder;

    // 拓展
    @ApiModelProperty(value = "商品详情" )
    private String detail;

    @ApiModelProperty(value = "总库存" )
    private Integer totalStock;

    @ApiModelProperty(value = "商品销量" )
    private Integer saleNum;

    @ApiModelProperty(value = "商铺名称" )
    private String shopName;

    @ApiModelProperty(value = "商铺logo" )
    private String shopLogo;

    @ApiModelProperty(value = "商铺类型" )
    private Integer shopType;

    @ApiModelProperty(value = "规格属性" )
    private List<AppSpuAttrValueVO> spuAttrValues;

    @ApiModelProperty(value = "sku列表" )
    private List<AppSkuVO> skus;
}
